<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Cache-Control" content="no-cache"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>

	<title>Dialog-Data-Select</title>

		
</h:head>
<h:body >
faces-config.xml
    application
        action-listener
			org.primefaces.application.DialogActionListener 
		action-listener
        navigation-handler
        	org.primefaces.application.DialogNavigationHandler
        navigation-handler
        view-handler
        	org.primefaces.application.DialogViewHandler
        view-handler
    application

<h:form>
	1：
    <p:growl id="growl" showDetail="true" /> 
    <p:commandButton value="Select Oper" icon="ui-icon-extlink" actionListener="#{dfView.chooseOper}">
        <p:ajax event="dialogReturn" listener="#{dfView.onOperChosen}" update="growl" />
    </p:commandButton>
    
    2：
    <p:commandButton value="Dialog..." type="button" onclick="PF('dlg').show();" />
	
	<p:dialog header="选择数据" widgetVar="dlg" modal="true"  appendTo="@(body)"  
		dynamic="true" closeOnEscape="true"  height="540" width="1280">
            <p:dataTable var="row" value="#{dfView.opers}">
                <p:column headerText="Username">
                    <h:outputText value="#{row.username}" />
                </p:column>
 
                <p:column headerText="Password">
                    <h:outputText value="#{row.password}" />
                </p:column>
 
                <p:column style="width:32px;text-align: center">
                    <p:commandButton icon="ui-icon-search" oncomplete="PF('dlg').hide();"/>
                </p:column>
            </p:dataTable>
	</p:dialog>     
</h:form>


	
</h:body>
</html>
